package cn.itcast.controller;

import cn.itcast.service.ChatService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
public class ChatController {

    @Resource
    private ChatService chatService;

    @PostMapping("/chat")
    public String chat(String question) {
        return this.chatService.chat(question);
    }
}
